import { IPSSysDBColumn } from './ipssys-dbcolumn';
import { IPSSysDBIndex } from './ipssys-dbindex';
import { IPSSysDBTable } from './ipssys-dbtable';
import { PSModelObjectImpl } from '../psmodel-object-impl';

export class PSSysDBTableImpl extends PSModelObjectImpl implements IPSSysDBTable {
  protected allpssysdbcolumns: IPSSysDBColumn[] | null = null;

  getAllPSSysDBColumns(): IPSSysDBColumn[] | null {
    if (this.allpssysdbcolumns == null) {
      this.allpssysdbcolumns = this.fillChildListModel(this.M.getAllPSSysDBColumns, 'database.IPSSysDBColumn') as IPSSysDBColumn[];
    }
    return this.allpssysdbcolumns;
  }

  get allPSSysDBColumns(): IPSSysDBColumn[] | null {
    return this.getAllPSSysDBColumns();
  }

  findPSSysDBColumn(objKey: any): IPSSysDBColumn | null {
    return this.getPSModel5('database.IPSSysDBColumn', this.getAllPSSysDBColumns(), objKey) as IPSSysDBColumn;
  }

  protected allpssysdbindices: IPSSysDBIndex[] | null = null;

  getAllPSSysDBIndices(): IPSSysDBIndex[] | null {
    if (this.allpssysdbindices == null) {
      this.allpssysdbindices = this.fillChildListModel(this.M.getAllPSSysDBIndices, 'database.IPSSysDBIndex') as IPSSysDBIndex[];
    }
    return this.allpssysdbindices;
  }

  get allPSSysDBIndices(): IPSSysDBIndex[] | null {
    return this.getAllPSSysDBIndices();
  }

  findPSSysDBIndex(objKey: any): IPSSysDBIndex | null {
    return this.getPSModel5('database.IPSSysDBIndex', this.getAllPSSysDBIndices(), objKey) as IPSSysDBIndex;
  }

  get codeName(): string {
    return this.M.codeName;
  }

  get createSql(): string {
    return this.M.createSql;
  }

  get dropSql(): string {
    return this.M.dropSql;
  }

  get dynaModelFilePath(): string {
    return this.M.dynaModelFilePath;
  }

  get logicName(): string {
    return this.M.logicName;
  }

  get memo(): string {
    return this.M.memo;
  }

  get name(): string {
    return this.M.name;
  }

  get userCat(): string {
    return this.M.userCat;
  }

  get userTag(): string {
    return this.M.userTag;
  }

  get userTag2(): string {
    return this.M.userTag2;
  }

  get userTag3(): string {
    return this.M.userTag3;
  }

  get userTag4(): string {
    return this.M.userTag4;
  }

  get autoExtendModel(): boolean {
    return this.M.autoExtendModel;
  }

  get existingModel(): boolean {
    return this.M.existingModel;
  }

  get cls(): string {
    return 'PSSysDBTableImpl';
  }

  instanceof(cls: string): boolean {
    if (cls == 'database.IPSSysDBTable') return true;
    return super.instanceof(cls);
  }
}
